/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eSales.com.BL;

import eSales.com.DAL.Lot;
import eSales.com.WS.DBService;
import eSales.com.WS.DBService_Service;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

/**
 *
 * @author Home
 */
public class HTMLGenerator {
    
    private static final DBService_Service service;
    private static final DBService port;
    
        static {
        service = new DBService_Service();
        port = service.getDBServicePort();
    }
    
    public static void main(String[] args) {
      //  generateHTML("one", "two", "JavaScript");
        System.out.println("Before");
        Lot str = port.getString();
        System.out.println("Res: " + str);
        
         
    }

    public static void generateHTML(String targetFile, String xslSchema, String filterParam){
        try {
            TransformerFactory tFactory = TransformerFactory.newInstance(); 
            Transformer transformer;
            
            substituteFilterValues(filterParam, "howto.xxl");
               
            transformer = tFactory.newTransformer (new StreamSource ("howto.xsl"));
            transformer.setParameter("FILTER", filterParam);
            transformer.transform(new StreamSource("howto.xml"),new StreamResult ( new FileOutputStream("howto.html")));
            System.out.println("GENERATED");
            
        } catch (Exception  ex) {
            ex.printStackTrace();
        }
    }

    private static void substituteFilterValues(String filterParam, String schema) {
        
    }

    
}
